package cn.hengzhu.main_manager.service;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

import cn.hengzhu.main_manager.repository.domain.ManageCase;
import cn.hengzhu.main_manager.repository.domain.ManageCaseBox;
import cn.hengzhu.main_manager.repository.domain.ManageCaseType;
import cn.hengzhu.main_manager.repository.domain.ManageComp;
import cn.hengzhu.main_manager.repository.domain.ManageRoles;
import cn.hengzhu.main_manager.repository.domain.PayOrder;
import cn.hengzhu.main_manager.repository.param.UpdateUserLoginParam;
import cn.hengzhu.main_manager.repository.vo.CaseInitVO;
import cn.hengzhu.main_manager.repository.vo.ManageCaseBoxVO;
import cn.hengzhu.main_manager.repository.vo.OpenBoxListVO;

public interface ManageCaseBoxService {

	void addRecorByAdmin(String caseNo, Integer boxNum, String loginName);

	OpenBoxListVO getBoxList(String caseNo, String fromUserName);

	Map<String, String> getOpenDoor(String fromUserName, String caseNo, Integer boxNum) throws Exception;

	Map<String, String> oneKeyOpen(String caseNo, String fromUserName) throws Exception;

	void boxClearByWX(Integer boxId, String fromUserName);

	void clearBind(ManageRoles manageRoles);

	void clearBindByUpadateManager(UpdateUserLoginParam param);

	void addComp(ManageComp param);

	void setDefaultType(Integer typeId2, ManageCaseType manageCaseType) throws Exception;

	void payBack(Map<String, String> map) throws Exception;

	void openBoxByXcx(ManageCaseBox manageCaseBox, String openId) throws Exception;

	void backPayApply(Map<String, String> map1) throws Exception;

	void successBackPay(Map<String, String> doXMLParse);

	void failBackPay(Map<String, String> doXMLParse);

	void closeBoxAndPay(CaseInitVO readValue);

	void openBoxByAliXcx(ManageCaseBox manageCaseBox, String openId) throws Exception;

	void payFinishByAli(PayOrder payOrder);

	void payCaseFinish(PayOrder payOrder);

	void payFinishByAliAndCommonBox(PayOrder payOrder, ManageCaseBox manageCaseBox, ManageCase manageCase, Long time);

	void openBoxCommonByXcx(ManageCaseBox manageCaseBox, String openId, Byte type, Byte source, Byte saveSource,
			Integer clearHour, Byte payType, Byte payTime, String password) throws Exception;

	 void openBoxCommonByNewXcx(ManageCaseBox manageCaseBox, String openId, Byte type, Byte source, Byte saveSource,
									  Integer clearHour, Byte payType, Byte payTime, String aounmt, String priceId) throws Exception;

	void openBoxCommonByNewXcx(ManageCaseBox manageCaseBox, String openId, Byte type, Byte source, Byte saveSource,
									  Integer clearHour, String aounmt) throws Exception;
	List<ManageCaseBox> availableCabinet(String caseNo);

	void openMyCommonBoxByXcx(ManageCaseBox manageCaseBox, String openId, Byte type, Byte source) throws Exception;
	/**
	 * @author
	 * @since 2020年7月6日
	 * @param manageCaseBox 储物柜
	 * @param openId 用户id
	 * @param type 类型
	 * @param source 来源
	 * @param cost 入账费用 单位元
	 * @throws Exception
	 *  支付宝、微信、开箱取物逻辑（普通柜）
	 */
	void openMyCommonBoxByXcx(ManageCaseBox manageCaseBox, String openId, Byte type, Byte source,BigDecimal cost) throws Exception;

	void paySuccessByWx(ManageCaseBox manageCaseBox, Map<String, String> map1, String outTradeNo);

	void boxClear(ManageCaseBox manageCaseBox, ManageCase manageCase) throws Exception;

	void payCommonCaseWXFinish(Map<String, String> map, PayOrder payOrder, ManageCaseBox manageCaseBox);

	void prepayCommonCaseWXFinish(Map<String, String> map, PayOrder payOrder, ManageCaseBox manageCaseBox)
			throws Exception;

	void prepaySucessToOpen(PayOrder payOrder) throws Exception;

	void boxClearBatch(List<ManageCaseBox> manageCaseBoxList, ManageCase manageCase, ManageCaseType manageCaseType)
			throws Exception;

	/**
	 * @author liuCheng
	 * @since 2018年12月19日 下午1:18:03
	 * @param boxIdList
	 *            快递柜批量清柜逻辑
	 */
	void clearBoxByExpress(List<Integer> boxIdList, String loginName) throws Exception;

	/**
	 * @author liuCheng
	 * @since 2018年12月21日 上午10:05:00
	 * @param map
	 * @param payOrder
	 * @param manageCaseBox
	 *            中途取件逻辑
	 */
	void payMidWayCommonCaseWXFinish(Map<String, String> map, PayOrder payOrder, ManageCaseBox manageCaseBox);

	void openMidWayMyCommonBoxByXcx(ManageCaseBox manageCaseBox, String openId, Byte getType, Byte wxXcxSource)
			throws Exception;

	/**
	 * @author liuCheng
	 * @since 2018年12月21日 下午4:39:24
	 * @param payOrder
	 * @param manageCaseBox
	 * @param manageCase
	 * @param time中途取物
	 */
	void payFinishByAliAndCommonBoxMidWay(PayOrder payOrder, ManageCaseBox manageCaseBox, ManageCase manageCase,
			Long time);

	void clearByOneself(ManageCaseBox manageCaseBox, ManageCase manageCase, ManageCaseType manageCaseType, Byte source,
			Byte type) throws Exception;
	/**
	 * @param manageCaseBox 储物柜柜门
	 * @param manageCase 储物柜
	 * @param manageCaseType 收费类型
	 * @param source 来源
	 * @param type 类型
	 * @param cost 入公司账单费用 单位元
	 */
	void clearByOneself(ManageCaseBox manageCaseBox, ManageCase manageCase, ManageCaseType manageCaseType, Byte source,
			Byte type,BigDecimal cost) throws Exception;

	void continueCommonCaseFinish(String transactionId, BigDecimal amount, PayOrder payOrder,
			ManageCaseBox manageCaseBox, Byte source) throws Exception;

	/**
	 * @author liuCheng
	 * @since 2019年1月21日 上午11:15:41
	 * @param num
	 */
	void clearBoxToSwim(ManageCaseBox manageCaseBox);

	void saveToSwim(ManageCaseBox manageCaseBox);

	void clearBoxToSwimToCase(Integer boxId, Date savaDate);

	void clearBoxToSwimToCaseBatch(String mac, Date savaDate);

	/**
	 * @author liuCheng
	 * @since 2019年1月23日 下午3:28:19
	 * @param manageCaseBox
	 *            离场清柜
	 */
	void clearBoxByOut(ManageCaseBox manageCaseBox);

	/**
	 * 自己清除支付后续
	 * 
	 * @author 周磊
	 * @since 2019年6月28日
	 * @param payOrder
	 * @param manageCaseBox
	 * @param manageCase
	 * @param time
	 */
	void clearPayFinishByAli(PayOrder payOrder, ManageCaseBox manageCaseBox, ManageCase manageCase, Long time);

	/**
	 * 自己清除支付后续
	 * 
	 * @author 周磊
	 * @since 2019年6月28日
	 * @param payOrder
	 * @param manageCaseBox
	 * @param manageCase
	 * @param time
	 */
	void clearPayFinishByWx(PayOrder payOrder, ManageCaseBox manageCaseBox, ManageCase manageCase, Long time);

    Map<String, Object> carRental(ManageCaseBoxVO vo);

	Map<String, Object> chargesForUnpacking(PayOrder payOrder, String priceId);

    Map<String, Object> endUse(ManageCaseBox boxVO);

	Map<String, Object> continued(ManageCaseBox caseBox);

	Map<String, Object> continuedUse(ManageCaseBox caseBox);
}
